<link rel="stylesheet" href="../addons/jy_merch/css/mobile.css?v=1">
<style>
.fui-block-group {
    border-radius:0.5rem
}
.fui-block-group .fui-block-child {
    background: #fff;
}
.fui-block-group .fui-block-child .icon {height: auto; padding-top: 0.3rem; text-align: center; font-size: 1.3rem;}
.fui-block-group .fui-block-child .icon i { font-size:1.3rem;}
.fui-block-group .fui-block-child .title {
    height: auto;
    font-size: 0.6rem;
    line-height: 1.4
    text-align: center;
    color: #333;
}
.fui-block-group.new:after{content: " "; position: absolute; left: 0.5rem; right: 0.5rem; top: 50%; height: 1px; color: #D9D9D9; -webkit-transform-origin: 0 0; -ms-transform-origin: 0 0; transform-origin: 0 0; -webkit-transform: scaleY(0.5); -ms-transform: scaleY(0.5); transform: scaleY(0.5);}
.fui-block-group.new:before{content: " "; position: absolute; top: 0.5rem; bottom: 0.5rem; left: 50%; width: 1px; border-left: 1px solid #ebebeb; color: #D9D9D9; -webkit-transform-origin: 0 0; -ms-transform-origin: 0 0; transform-origin: 0 0; -webkit-transform: scaleX(0.5); -ms-transform: scaleX(0.5); transform: scaleX(0.5);z-index: 2}
.fui-block-group .fui-block-child.new{display: -webkit-box;  display: -webkit-flex;  display: -ms-flexbox;  display: flex;  -webkit-box-align: center;-webkit-align-items: center;  -ms-flex-align: center;  align-items: center;-webkit-box-pack: start; -ms-flex-pack: start; -webkit-justify-content: flex-start; justify-content: flex-start;padding-left: .6rem; height: 3.7rem }
.fui-block-group .fui-block-child .text.new{height: auto;line-height: normal;margin-left: .6rem;font-size: .6rem;color: #999;text-align: left}
.fui-cell-group .fui-cell .fui-cell-icon .text-yellow{color: red}
.fui-block-group .fui-block-child .title{height: auto;line-height: normal;font-size: .7rem;color: #000;text-align: center}
.fui-block-group .fui-block-child .text.new .title{text-align: left}
.fui-block-group .fui-block-child .text span{color: #999}
.fui-block-group .fui-block-child .icon{padding-top: 0;line-height: 2.7rem}
.fui-block-group .fui-block-child .icon i{font-size: 1.3rem}
.fui-block-group .fui-block-child.new:before{display: none}
.fui-block-group .fui-block-child.new:after{display: none}
</style>
<div class='fui-page fui-page-current'>
    <div style="background: #05c175;padding:0.4rem">
        <a href="javascript:;" ng-click="pagedata.showmerchs=true" style="border-radius: 1rem;padding:0.2rem 0.3rem;font-size:0.6rem; background-color: #059b5e;width:auto;color:#fff"><i class="icon icon-qiehuan" style="font-size:0.6rem"></i> 切换商户</a>
    </div>
    <div class='fui-content'>
	<div ng-if="pagedata.tips" ng-click="access_json('jy_quanhuo/open/')" class="tips tips-yellow" style="margin:0">
			<i class="fa fa-bullhorn"></i> {{pagedata.tips}}
	</div>
	<div style="background: #05c175;padding:0.5rem;margin-top:0;padding-bottom:1.6rem;">
			<div class="fui-cellone" style="padding:0">
				<div class="fui-cellone-label" style="width:auto;">
					<img style="border-radius: 0.2rem;width:2.2rem;height:2.2rem" ng-src="{{tomedia(pagedata.item.logo) || '../core/resource/images/gw-user.png'}}" />
				</div>
				<div class="fui-cellone-text" style="font-size:0.7rem;color:#fff;padding-left:0.5rem">
					<div class="bold">{{pagedata.item.merchname || '商户名称'}} </div>
					<div ng-if="pagedata.item.groupid>0" style="font-size:0.6rem">
					<span class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">{{pagedata.mygroup.groupname}}</span>
					有效期:{{pagedata.item.viptime2}} 
					<span class="jylabel jylabel-success" style="color:#FCC600;border: 1px solid #FCC600;" ng-click="access_json('jy_quanhuo/open/')">续费>></span>
					</div>
					<div style="font-size:0.6rem">{{pagedata.item.num || 0}}个活动 </div>
				</div>
				<div class="fui-cellone-remark noremark" style="font-size:0.7rem;color:#fff;">
					<i href="javascript:" ng-click="access_json('jy_merch/manage.shop/')" class="icon icon-set"></i>
				</div>
			</div>	
			<div class="fui-icon-group noborder  col-3" style="padding-top:0.5rem">
					<div class="fui-icon-col-sm external" style="margin:0">
													<div>
														<div class="subtitle" style="font-size:12px;color:#fff">今日访问</div>
														<div class="text bold" style="color:#fff;line-height:1.6rem;font-size:1rem">{{pagedata.looks || '0'}}</div>
													</div>
					</div>
					<div class="fui-icon-col-sm external" style="margin:0">
													<div>
														<div class="subtitle" style="font-size:12px;color:#fff">今日订单</div>
														<div class="text bold" style="color:#fff;line-height:1.6rem;font-size:1rem">{{pagedata.ordernum || 0}}</div>
														
													</div>
					</div>
					<div ng-click="access_json('/merchfeelog//merchid='+pagedata.item.id)" class="fui-icon-col-sm external" style="margin:0">
								<div>
									<div class="subtitle" style="font-size:12px;color:#fff">今日营收 <span style="color:#FCC600">更多>></span></div>
									<div class="text bold" style="color:#fff;line-height:1.6rem;font-size:1rem">{{pagedata.orderfee || 0.00}}</div>
								</div>
					</div>
			</div>			
	</div>
	<div style="padding:0.5rem;margin-top:-2rem">
			<div class="fui-icon-group noborder  col-4" style="background:#fff">
					<div class="fui-icon-col-sm external" style="margin:0">
								<div>
									<div ng-click="pagedata.scancode()" class="text bold" style="line-height:1.6rem;font-size:1rem">
												<i class="icon icon-saoyisao1" style="color:#039646;font-size: 1rem;"></i>
									</div>
								<div style="font-size:12px;">扫码核销</div>
								</div>
					</div>
					<div class="fui-icon-col-sm external" style="margin:0">
								<div>
									<div ng-click="access_json('jy_quanhuo/merchorder//merchid='+pagedata.item.id)" class="text bold" style="line-height:1.6rem;font-size:1rem">
												<i class="icon icon-dingdan" style="color:#039646;font-size: 1rem;"></i>
									</div>
								<div style="font-size:12px;">订单管理</div>
								</div>
					</div>
					<div class="fui-icon-col-sm external" style="margin:0">
								<div>
									<div ng-click="access_json('jy_quanhuo/myitem/')" class="text bold" style="line-height:1.6rem;font-size:1rem">
												<i class="icon icon-success" style="color:#039646;font-size: 1rem;"></i>
									</div>
								<div style="font-size:12px;">活动管理</div>
								</div>
					</div>
					<div class="fui-icon-col-sm external" style="margin:0">
								<div>
									<div ng-click="access_json('jy_quanhuo/tixian/')" class="text bold" style="line-height:1.6rem;font-size:1rem">
												<i class="icon icon-yiban" style="color:#039646;font-size: 1rem;"></i>
									</div>
								<div style="font-size:12px;">资金管理</div>
								</div>
					</div>
			</div>
			<div class="fui-cell-group fui-cell-click">
				<div class="fui-cell">
					<div class="fui-cell-info" style="font-size:0.7rem">
						<div class="bold">营销活动</div>
					</div>
					<div class="fui-cell-remark" style="font-size:0.7rem" href="javascript:" ng-click="access_json('jy_videomerch/myitem/')">
						复制已发布的活动
					</div>
				</div>	
				<div class="fui-block-group new col-2">
					<a ng-repeat="item in pagedata.allgames" class="fui-block-child new  external" href="javascript:;" ng-click="access_json('jy_videomerch/upitem//gamename='+item.name)">
						<div class="icon" style="color: #ff4357;">
							<img style="width:2rem;height:2rem;border-radius: 50%;" ng-src="{{tomedia(item.icon) || '../core/resource/images/nopic.jpg'}}"/>
						</div>
						<div class="text new">
							<div class="title bold">{{item.title}}</div>
							<div class="">{{item.desc}}</div>
						</div>
					</a>
				</div>
			</div>
			<div ng-click="access_json(pagedata.pluginset.indexadurl)" style="margin-top:0.5rem;height:auto;width: 100%;">
				<img style="width: 100%;height:auto" ng-src="{{tomedia(pagedata.pluginset.indexad) ||'../addons/jy_quanhuo/resource/images/ad01.png'}}"/>
			</div>
			<div ng-click="access_json('/open/')" style="margin-top:0.5rem;height:auto;width: 100%;">
				<img style="width: 100%;height:auto" ng-src="{{tomedia(pagedata.pluginset.indexad2) ||'../addons/jy_quanhuo/resource/images/ad02.png'}}"/>
			</div>
			<div class="fui-cell-group" style="padding:0.5rem;border-radius:0.5rem">
				<div class="fui-cell" style="padding:0">
					<div class="fui-cell-label" style="width:auto;">
						<img style="border-radius: 50%;width:2rem;height:2rem" ng-src="{{tomedia(pagedata.pluginset.kf_logo) || '../core/resource/images/gw-user.png'}}" />
					</div>
					<div class="fui-cell-text" style="font-size:0.7rem">
						<div class="bold">专家顾问</div>
						<div class="subtitle" style="font-size:0.6rem">不知道怎么做活动，加我免费1对1服务</div>
					</div>
					<div class="fui-cell-remark noremark" style="font-size:0.7rem">
						<span href="javascript:" ng-click="access_json(pagedata.pluginset.kf_link);" class="jylabel jylabel-success" style="padding:0.3rem 0.6rem;border-radius:1rem;font-weight:400">添加</span>
					</div>
				</div>		
			</div>
		</div>
		<div style="padding:0.5rem;padding-top:0">
			<div class="fui-cell-title bold">
                活动订单管理
            </div>
            <div class="fui-block-group col-3">
                    <a class="fui-block-child" ng-click="access_json('jy_quanhuo/merchorder//status=1')">
                        <div class="icon text-blue">
							<i class="icon icon-daifahuo"></i>
						</div>
                        <div class="title">待发货</div>
						<div class="badge" ng-if="pagedata.gamestatus1>0">{{pagedata.gamestatus1}}</div>
                    </a>
                
                    <a class="fui-block-child" ng-click="access_json('jy_quanhuo/merchorder//status=0')">
                        <div class="icon text-yellow">
							<i class="icon icon-daifukuan1"></i>
						</div>
                        <div class="title">待付款</div>
						<div class="badge" ng-if="pagedata.gameispay>0">{{pagedata.gameispay}}</div>
                    </a>
               
                    <a class="fui-block-child" ng-click="access_json('jy_quanhuo/merchorder//status=2')">
                        <div class="icon text-orange">
                            <i class="icon icon-daishouhuo1"></i>
                        </div>
                        <div class="title">待收货</div>
						<div class="badge" ng-if="pagedata.gamestatus2>0">{{pagedata.gamestatus2}}</div>
                    </a>
                
			</div>
            <div class="fui-cell-title bold">
                商城订单管理
            </div>
            <div class="fui-block-group col-3">
                    <a class="fui-block-child" ng-click="access_json('jy_merch/manage.order_list//status=1')">
                        <div class="icon text-blue">
							<i class="icon icon-daifahuo"></i>
						</div>
                        <div class="title">待发货</div>
						<div class="badge" ng-if="pagedata.status1>0">{{pagedata.status1}}</div>
                    </a>
                
                    <a class="fui-block-child" ng-click="access_json('jy_merch/manage.order_list//status=0')">
                        <div class="icon text-yellow">
							<i class="icon icon-daifukuan1"></i>
						</div>
                        <div class="title">待付款</div>
						<div class="badge" ng-if="pagedata.ispay>0">{{pagedata.ispay}}</div>
                    </a>
               
                    <a class="fui-block-child" ng-click="access_json('jy_merch/manage.order_list//status=2')">
                        <div class="icon text-orange">
                            <i class="icon icon-daishouhuo1"></i>
                        </div>
                        <div class="title">待收货</div>
						<div class="badge" ng-if="pagedata.status2>0">{{pagedata.status2}}</div>
                    </a>
                
			</div>
        <div class="fui-cell-title bold">
                商户管理
        </div>
        <div class="fui-block-group col-3">         
                <a class="fui-block-child" ng-click="access_json('jy_merch/manage.good_list/')">
                    <div class="icon text-yellow">
                        <i class="icon icon-tianmaopaidui"></i>
                    </div>
                    <div class="title">商品管理</div>
					<div class="badge" ng-if="pagedata.goods>0">{{pagedata.goods}}</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_merch/manage.good_list//status=3')">
                    <div class="icon text-blue">
                        <i class="icon icon-delete"></i>
                    </div>
                    <div class="title">回收站商品</div>
					<div class="badge" ng-if="pagedata.delgoods>0">{{pagedata.delgoods}}</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_merch/manage.good_list/edit')">
                    <div class="icon text-orange">
                        <i class="icon icon-shuru"></i>
                    </div>
                    <div class="title">添加商品</div>
                </a>
				<a ng-if="pagedata.pluginset.is_good_jin==1" class="fui-block-child" ng-click="access_json('jy_merch/manage.selectgoods/')">
                    <div class="icon text-blue">
                        <i class="icon icon-cart1"></i>
                    </div>
                    <div class="title">平台采集商品</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_merch/manage.good_group/list/')">
                    <div class="icon text-yellow">
                        <i class="icon icon-compass"></i>
                    </div>
                    <div class="title">商品分类</div>
                </a>
                <a class="fui-block-child" ng-click="access_json('jy_merch/manage.shop/')">
                    <div class="icon text-orange">
                        <i class="icon icon-set"></i>
                    </div>
                    <div class="title">店铺设置</div>
                </a>
				 <a class="fui-block-child" ng-click="access_json('jy_merch/manage.catefans/')">
                    <div class="icon text-orange">
                        <i class="icon icon-gerenzhongxin"></i>
                    </div>
                    <div class="title">粉丝管理</div>
                </a>
				 <a class="fui-block-child" ng-click="access_json('jy_merch/manage.member/')">
                    <div class="icon text-orange">
                        <i class="icon icon-account"></i>
                    </div>
                    <div class="title">会员管理</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_merch/manage.tihuo/')">
                    <div class="icon text-red">
                        <i class="icon icon-map"></i>
                    </div>
                    <div class="title">提货点</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_videomerch/merchitem/')">
                    <div class="icon text-red">
                        <i class="icon icon-dianpu"></i>
                    </div>
                    <div class="title">店铺入口</div>
                </a>
        </div>
		<div class="fui-cell-title bold">
                店铺工具
         </div>
        <div class="fui-block-group col-3" style="height:auto;width:100%;margin-top:0.15rem">          
                <div ng-click="pagedata.scancode()" class="fui-block-child">
                    <div class="icon text-yellow">
                        <i class="icon icon-saoyisao2"></i>
                    </div>
                    <div class="title">核销</div>
                </div>
				<div ng-click="pagedata.payewmshow=true;pagedata.show_payverify();" class="fui-block-child">
                    <div class="icon text-orange">
                        <i class="icon jinyunicon icon-fukuanma"></i>
                    </div>
                    <div class="title">收款码</div>
                </div>
				<div ng-click="pagedata.ewmshow=true;pagedata.show_verify();" class="fui-block-child">
                    <div class="icon text-blue">
                        <i class="icon jinyunicon icon-qrcode"></i>
                    </div>
                    <div class="title">店铺码</div>
                </div>
				<div ng-click="access_json('jy_merch/manage.printer/')" class="fui-block-child">
                    <div class="icon text-red">
                        <i class="icon jinyunicon icon-print"></i>
                    </div>
                    <div class="title">打印机</div>
                </div>
        </div>
		<div class="fui-cell-group fui-cell-click mod-group">
					<a class="fui-cell" href="javascript:;" ng-click="access_json('jy_merch/manage.refund/')">
								<div class="fui-cell-icon"><i class="icon icon-caifua"></i></div>
								<div class="fui-cell-text">
												退款管理
								</div>
								<div class="fui-cell-remark"></div>
					</a>
		</div>
		<div ng-if="pagedata.pluginset.is_dianwxapp==1" class="fui-cell-group fui-cell-click mod-group">
					<a class="fui-cell" href="javascript:;" ng-click="access_json('jy_merch/manage.addwxapp/')">
								<div class="fui-cell-icon"><i class="icon icon-xiaochengxu"></i></div>
								<div class="fui-cell-text">
												申请小店小程序
								</div>
								<div class="fui-cell-remark"></div>
					</a>
		</div>
		
        <div class="fui-title center">更多设置请至PC端后台</div>
		<div class='btn btn-success block btn-submit' href="javascript:" ng-click="post_json('core/member.logout/')">退出登录</div>
    </div>
	 </div>
</div>
<div ng-if="pagedata.showmerchs" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showmerchs=false"></i>
			<div class="fui-list-group" style="border-radius: 0.5rem;background:#fff;margin: 0;padding-bottom:2.5rem;max-height:22rem;overflow-y:scroll">
					<a class="fui-list"  ng-repeat="item in pagedata.merchs" href="javascript:;" ng-click="access_json('jy_quanhuo/merch//merchid='+item.id)">
						<div class="fui-list-media">
							<i class="icon icon-map"></i>
						</div>
						<div class="fui-list-inner">
							<div class="subtitle" >
								<span class='realname'>{{item.merchname}}</span>
							</div>
							<div class="text address">地址：{{item.address}}</div>
						</div>
						<div class="fui-list-angle">
							<div class="angle"></div>
						</div>
					</a>
			</div>
			<div class="fui-navbar">
				<a class="nav-item btn cartbtn" ng-click="access_json('jy_merch/register/get/add=1')">添加商户</a>
				<a class="nav-item btn buybtn" ng-click="post_json('core/member.logout/')">切换账户</a>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.payewmshow" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="background:#fc6d60">
			<style>
				input{ caret-color: #fff}
				.fui-cell-group .fui-cell .fui-cell-info  ::-webkit-input-placeholder{
					color: #fff
				}
				.fui-cell-group .fui-cell .fui-cell-info {
					font-size: 0.85rem;
					color: #fff;
				}
			</style>
			<i class="closed icon icon-cuowu" ng-click="pagedata.payewmshow=false"></i>
			 <div class='fui-cell-group fui-cell-group-o' style="margin:0.5rem 2rem;padding-top:0.5rem;background:#fc6d60">
				<div class='fui-cell-title c' style="color:#fff">【收款码】
				</div>
				<div class='fui-cell' style="padding-bottom:0">
					<div class="fui-cell-text c">
						<div class="img_box" id="show_payverify_ewm">
						</div>
					</div>
				</div>
				<div class='fui-cell' style="margin-top:0;padding-top:0">
					<div class="fui-cell-text">
					<div class="error c">
						<p style="padding: 0 1.3rem">温馨提示：请用微信扫一扫！</p>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.ewmshow" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="background:#fc6d60">
			<style>
				input{ caret-color: #fff}
				.fui-cell-group .fui-cell .fui-cell-info  ::-webkit-input-placeholder{
					color: #fff
				}
				.fui-cell-group .fui-cell .fui-cell-info {
					font-size: 0.85rem;
					color: #fff;
				}
			</style>
			<i class="closed icon icon-cuowu" ng-click="pagedata.ewmshow=false"></i>
			 <div class='fui-cell-group fui-cell-group-o' style="margin:0.5rem 2rem;padding-top:0.5rem;background:#fc6d60">
				<div class='fui-cell-title c' style="color:#fff">【店铺码】
				</div>
				<div class='fui-cell' style="padding-bottom:0">
					<div class="fui-cell-text c">
						<div class="img_box" id="show_verify_ewm">
						</div>
					</div>
				</div>
				<div class='fui-cell' style="margin-top:0;padding-top:0">
					<div class="fui-cell-text">
					<div class="error c">
						<p style="padding: 0 1.3rem">温馨提示：请用微信扫一扫！</p>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<audio id="openvoice" controls preload="auto" style="display:none;">
	<source src="../core/resource/images/neworder.mp3"></source>
</audio>
<script>
scope.pagedata.scancode=function () {
			console.log('scanQRCodeOK');
			wx.scanQRCode({
				needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
				scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
				success: function (res) {
					var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
					location.href = result;
				}
			});
}
scope.pagedata.show_verify=function(){
	var url=scope.pagedata.item.url;
	scope.tool.qr(url,'show_verify_ewm',150)
}
scope.pagedata.show_payverify=function(){
	var url=scope.pagedata.item.payurl;
	scope.tool.qr(url,'show_payverify_ewm',150)
}	
scope.pagedata.openvoice=function(type){
	var voicetime = 0;
    var openvoice;
	scope.post_json('jy_merch/manage.shop/openvoice/isopenvoice='+scope.pagedata.isopenvoice,{},function(res){
	});
	if(type==1){
		 openvoice = setInterval(() => {
			if(scope.pagedata.isopenvoice!=1){
				clearInterval(openvoice);
				return false;
			}
			scope.get('jy_weishop/order.list/getnew/merchid='+scope.pagedata.item.id,function(res){
						console.log('openvoice');console.log(res);
						if(res!='none'){
							voicetime ++;
							$("#openvoice")[0].play();
						}
			});
		}, 5000);
	}
}
</script>